$regPath="HKLM:\SOFTWARE\microsoft\windows\currentversion\uninstall\"
$flag = 0
pushd $regPath


$results = [System.IO.File]::Exists("C:\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools for Office\PIA\Office12\Microsoft.Office.Interop.Excel.dll")

if ($results -eq $true)
{ 
  $results = ls $regPath | foreach($_) { Get-ItemProperty $_.PSChildName } | where {$_.DisplayName -match "Microsoft SQL Server 2005 Compact Edition"}
 
  if ($results -ne $null)
  {
     popd
     $flag = 1

     $buildScriptPath = (resolve-path '.\1b - Build LitwareHR Smart Client.bat')

     & $buildSCriptPath

  }

}

if ($flag -eq 0)
{
  popd
}